package com.ou.work;

import org.springframework.amqp.rabbit.annotation.Queue;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

@Component
public class WorkConsumer {

    //第一个消费者
    @RabbitListener(queuesToDeclare = @Queue("work"))
    public void receivel1(String message){
        System.out.println("message1 = "+message);
    }

    //第二个消费者
    @RabbitListener(queuesToDeclare = @Queue("work"))
    public void receivel2(String message){
        System.out.println("message2 = "+message);
    }



}
